package com.ma.chapter4.t8;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.locks.LockSupport;

/**
 * @ClassName OrderControl3
 * @Author: mayongqiang
 * @DATE 2022/3/16 20:10
 * @Description:
 */
@Slf4j(topic = "m.test")
public class OrderControl3 {

    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            LockSupport.park();
            log.debug("1");
        }, "t1");
        t1.start();
        new Thread(() -> {
            log.debug("2");
            LockSupport.unpark(t1);
        }, "t2").start();

    }
}
